#ifndef DOHTTP_H
#define DOHTTP_H

#include <QThread>
#include <QtNetwork/QNetworkAccessManager>
#include <QtNetwork/QNetworkReply>
#include <QtNetwork/QNetworkRequest>
#include <QEventLoop>
class DoHttp : public QThread
{
    Q_OBJECT
public:
    explicit DoHttp(QObject *parent = 0);
    void run();
    void setReq(QString req);
    bool runrun;
    void startQuery( QString str);
signals:
    void send_msg(const QString msg);
public slots:
    void slot_httpFinished();
    void slot_httpError(QNetworkReply::NetworkError);


private:
    QNetworkAccessManager* qnam;
    QNetworkReply* reply;
    QString query_word;
    bool is_init;
    QString req;
};

#endif





